#!/usr/bin/env python
'''About dialog

Display the about dialog
'''

import pygtk
pygtk.require("2.0")
import gtk
import os

from phbook import APP_PATH
import Config

class AboutWindow(gtk.AboutDialog):
    '''Display the about dialog'''

    def __init__(self):
        '''Show the about dialog'''
        gtk.AboutDialog.__init__(self)

        self.set_name(Config.get_config("title"))
        self.set_version(Config.get_config("version"))
        self.set_authors(['Giuliani Vito, Ivan <giuliani@technosec.net>'])
        self.set_comments(_("A GTK Phone Book completely written in Python"))
        self.set_website("http://code.google.com/p/phbook/")
        self.set_copyright(Config.get_config("copyright"))

        try:
            c = APP_PATH + os.sep + "COPYING"
            f = file(c, "r")
            self.set_license(f.read())
        except:
            self.set_license("GNU General Public License version 2")

        self.connect("destroy", lambda w: self.destroy(w))
        self.show_all()
